package datastruct.set;

import datastruct.tree.BinarySearchTree;

/**
 * @author RunningShrimp
 * @date 2021/5/17  10:08
 */
public class BinaryTreeSet<E extends Comparable<E>> implements Set<E> {

    private final BinarySearchTree<E> tree;

    public BinaryTreeSet() {
        this.tree = new BinarySearchTree<>();
    }

    @Override
    public void add(E e) {
        tree.add(e);
    }

    @Override
    public void remove(E e) {
        tree.remove(e);
    }

    @Override
    public boolean contains(E e) {
        return tree.contains(e);
    }

    @Override
    public int getSize() {
        return tree.getSize();
    }

    @Override
    public boolean isEmpty() {
        return tree.isEmpty();
    }

}
